/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-04-19
 * Time:0:18
 */
class Base{

    public Base(String s){

        System.out.print("B");

    }

}

public class Derived extends Base{




    //编译错误，若用户写了父类有参数的构造方法，此时子类要自己写出调用父类的构造方法
    public Derived (String s) {
        super(s);//调用父类的构造方法

        System.out.print("D");

    }

    public static void main(String[] args){

        new Derived("C");

    }

}